package com.shark.example.services
{
	import com.shark.example.vos.User;
	
	import flash.events.IEventDispatcher;
	
	import mx.rpc.AsyncToken;
	
	import org.swizframework.utils.services.MockDelegateHelper;

	public class UserService
	{
		
		[Dispatcher]
		public var dispatcher:IEventDispatcher;
		
		private var mock:MockDelegateHelper;
		
		public function UserService()
		{
			mock = new MockDelegateHelper();
		}
		
		public function loginUser(user:User):AsyncToken{
			if(user.name == "Gus" && user.pass == "gabriel"){
				return mock.createMockResult(user);
			}else{
				return mock.createMockFault();
			}
		}
	}
}